<?php
/**
 * 信用额度提升
 * User: tengyu
 * Date: 2017/10/30
 * Time: 14:21
 */?>
@extends('common.common')
@section('title','提升信用额度')
@section('css')<link rel="stylesheet" href="{{asset('/css/up_deposit.css')}}">@endsection
@section('js')
    <script src="{{asset('/js/up_deposit.js')}}"></script>
    <script>
        /**提交申请额度资料*/
        function quota_add_post()
        {
            var apply_reason_data = document.getElementById('apply_reason_data').value;
            if(!apply_reason_data){
                alert('请填写您申请的理由(需求，资质等)');return false;
            }
            var apply = $("#apply").val();
            if(!apply){
                alert('请上传您的申请额度所需的文件!(一张)');return false;
            }
            var fileexsion = apply.substring(apply.lastIndexOf('.')+1,apply.length);
            var fileexist = new Array('jpg','png','gif','zip','rar','7z');
            if(jQuery.inArray(fileexsion,fileexist)=='-1'){
                alert('请上传我们要求的文件类型!');return  false;
            }
           $("#quota_add_post").submit();
        }
    </script>
@endsection
@section('content')
    <div id="content">
        @include('common.centernav')
        <h3>个人中心</h3>
        <div class="container">
            <div class="row">
            @include('usercenter.usersidebar')
                <!--2、右侧主体-->
                <div class="col-xs-9">
                    <!--右侧面版-->
                    <div class="panel panel-default rightPanel">
                        <div class="panel-heading"><h4>提升免押金额度</h4></div>
                        @if (count($errors) > 0)
                            <div class="alert alert-danger text-left">
                                <strong>注册信息不符合规范!</strong>
                                <ul>
                                    @if(is_object($errors))
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>
                                        @endforeach
                                    @else
                                        <li>{{$errors}}</li>
                                    @endif
                                </ul>
                            </div>
                        @endif
                        <div class="panel-body">
                            <!--创建内容组-->
                            <div id="information">
                                <form class="form-horizontal" action="{{url('/user/quota_add_post')}}" method="post" enctype="multipart/form-data" id="quota_add_post" >
                                    {!! csrf_field() !!}
                                    <div class="form-group">
                                        <label class="col-xs-3 control-label">申请理由：</label>
                                        <div class="col-xs-5">
                                            <textarea name="apply_reason" id="apply_reason_data"  class="reason" placeholder="请输入申请理由"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <!--占位-->
                                        <label class="col-xs-3 control-label"></label>
                                        <div class="col-xs-5">
                                            <p class="apply">提额申请，需要提供以下资料中的任意一项:</p>
                                            <p class="apply">a.人民银行征信报告（打印时间为1周内）</p>
                                            <p class="apply">b.公司的社保缴纳记录（过往3个月）</p>
                                            <p class="apply">c.公司的对公流水（过往3-6个月）</p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-3 control-label">上传附件：</label>
                                        <div id="up_apply" class="col-xs-6 upload">
                                            <div class="circle">+</div>
                                            <p class="up">点击上传</p>
                                        </div>
                                        <input type="file" id="apply" name="quota_apply">
                                        <div class="col-xs-4">
                                            最大8MB、附件支持格式<br>图片格式：JPG、PNG、GIF<br>压缩文件：RAR、ZIP、7Z
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <!--占位-->
                                        <label class="col-xs-3 control-label"></label>
                                        <div class="col-xs-5">
                                            <a class="btn btn-warning" onclick="quota_add_post()">立即申请</a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
